package com.lzh.others.tree.test;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;

/**
 * @Classname main
 * @Description TODO
 * @Date 2021/12/17 10:46
 * @Created by liuzihao
 */
public class main {


    public static void main(String[] args) {
        Logger logger = LoggerFactory.getLogger(main.class);
        Child childTest1 = new Child();
        childTest1.setName("child");
        childTest1.setCode("1");
        Child childTest2 = new Child();
        childTest2.setName("child");
        childTest2.setCode("2");

        /**
         * 对继承的父类属性 code 进行不同的赋值
         * 在不加 @EqualsAndHashCode(callSuper = true) 注解的情况下对这两个对象进行比较得到的结果却是 true
         */
        boolean isSame = Objects.equals(childTest1,childTest2);
        logger.info("testEquals -> childTest1:{}, childTest2:{}", childTest1, childTest2);
        logger.info("testEquals -> :{}", isSame);


    }
}
